package com.health.home.service.lmpl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.health.home.domain.po.TnewsCategoryPo;
import com.health.home.domain.vo.TnewsCategoryVo;
import com.health.home.mapper.TnewCategoryMapper;
import com.health.home.service.TnewCategoryServcie;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author xpz
 * @date 2024/12/16 11:19
 */
@Service
public class TnewCategoryServicelmpl extends ServiceImpl<TnewCategoryMapper, TnewsCategoryPo> implements TnewCategoryServcie{
    @Override
    public List<TnewsCategoryPo> newCategoryList(TnewsCategoryVo tnewsCategoryVo) {
        LambdaQueryWrapper<TnewsCategoryPo> wrapper = new LambdaQueryWrapper<>();
        if (StringUtils.isNotBlank(tnewsCategoryVo.getCategoryName())){
            wrapper.eq(TnewsCategoryPo::getNewsCategoryName,tnewsCategoryVo.getCategoryName());
        }
        List<TnewsCategoryPo> list = list(wrapper);
        return list;
    }
}
